home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / 92052tar.gz / 920528.tar / pktdrvr.h < prev    next >
C/C++ Source or Header  |  1992-05-28  |  4KB  |  124 lines

  1. /* @(#) $Header: pktdrvr.h,v 1.4 92/05/28 13:50:27 deyke Exp $ */
  2.  
  3. #ifndef _PKTDRVR_H
  4. #define _PKTDRVR_H
  5.  
  6. #ifndef _MBUF_H
  7. #include "mbuf.h"
  8. #endif
  9.  
  10. #ifndef _IFACE_H
  11. #include "iface.h"
  12. #endif
  13.  
  14. #define PK_MAX  3       /* Add extra interrupt hooks if you increase this */
  15.  
  16. /* Packet driver interface classes */
  17. #define CL_NONE         0
  18. #define CL_ETHERNET     1
  19. #define CL_PRONET_10    2
  20. #define CL_IEEE8025     3
  21. #define CL_OMNINET      4
  22. #define CL_APPLETALK    5
  23. #define CL_SERIAL_LINE  6
  24. #define CL_STARLAN      7
  25. #define CL_ARCNET       8
  26. #define CL_AX25         9
  27. #define CL_KISS         10
  28. #define CL_IEEE8023     11
  29. #define CL_FDDI         12
  30. #define CL_INTERNET_X25 13
  31. #define CL_LANSTAR      14
  32. #define CL_SLFP         15
  33. #define CL_NETROM       16
  34. #define CL_PPP          17
  35. #define CL_QTSO         18
  36. #define NCLASS          19
  37.  
  38. #ifdef  MSDOS
  39.  
  40. /* Packet driver interface types (not a complete list) */
  41. #define TC500           1
  42. #define PC2000          10
  43. #define WD8003          14
  44. #define PC8250          15
  45. #define ANYTYPE         0xffff
  46.  
  47. /* Packet driver function call numbers. From Appendix B. */
  48. #define DRIVER_INFO             1
  49. #define ACCESS_TYPE             2
  50. #define RELEASE_TYPE            3
  51. #define SEND_PKT                4
  52. #define TERMINATE               5
  53. #define GET_ADDRESS             6
  54. #define RESET_INTERFACE         7
  55. #define GET_PARAMETERS          10
  56. #define AS_SEND_PKT             11
  57. #define SET_RCV_MODE            20
  58. #define GET_RCV_MODE            21
  59. #define SET_MULTICAST_LIST      22
  60. #define GET_MULTICAST_LIST      23
  61. #define GET_STATISTICS          24
  62. #define SET_ADDRESS             25
  63.  
  64. /* Packet driver error return codes. From Appendix C. */
  65.  
  66. #define NO_ERROR        0
  67. #define BAD_HANDLE      1       /* invalid handle number */
  68. #define NO_CLASS        2       /* no interfaces of specified class found */
  69. #define NO_TYPE         3       /* no interfaces of specified type found */
  70. #define NO_NUMBER       4       /* no interfaces of specified number found */
  71. #define BAD_TYPE        5       /* bad packet type specified */
  72. #define NO_MULTICAST    6       /* this interface does not support multicast */
  73. #define CANT_TERMINATE  7       /* this packet driver cannot terminate */
  74. #define BAD_MODE        8       /* an invalid receiver mode was specified */
  75. #define NO_SPACE        9       /* operation failed because of insufficient space */
  76. #define TYPE_INUSE      10      /* the type had previously been accessed, and not released */
  77. #define BAD_COMMAND     11      /* the command was out of range, or not implemented */
  78. #define CANT_SEND       12      /* the packet couldn't be sent (usually hardware error) */
  79. #define CANT_SET        13      /* hardware address couldn't be changed (> 1 handle open) */
  80. #define BAD_ADDRESS     14      /* hardware address has bad length or format */
  81. #define CANT_RESET      15      /* couldn't reset interface (> 1 handle open) */
  82.  
  83. typedef union {
  84.     struct {
  85.         unsigned char lo;
  86.         unsigned char hi;
  87.     } byte;
  88.     unsigned short word;
  89. } ureg;
  90.  
  91. #define CARRY_FLAG      0x1
  92.  
  93. struct pktdrvr {
  94.     int class;      /* Interface class (ether/slip/etc) */
  95.     int intno;      /* Interrupt vector */
  96.     short handle1;  /* Driver handle(s) */
  97.     short handle2;
  98.     short handle3;
  99.     struct mbuf *buffer;    /* Currently allocated rx buffer */
  100.     struct mbuf *rcvq;      /* Receive queue */
  101.     struct iface *iface;
  102. };
  103.  
  104. extern struct pktdrvr Pktdrvr[];
  105.  
  106. /* In pktdrvr.c: */
  107. INTERRUPT pkint __ARGS((unsigned short bp, unsigned short di,
  108.      unsigned short si, unsigned short ds, unsigned short es,
  109.      unsigned short dx, unsigned short cx, unsigned short bx,
  110.      unsigned short ax, unsigned short ip, unsigned short cs,
  111.      unsigned short flags, int dev));
  112. void pk_tx __ARGS((int dev,void *arg1,void *unused));
  113. int pk_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,
  114.     int prec,int del,int tput,int rel));
  115.  
  116. /* In pkvec.asm: */
  117. INTERRUPT pkvec0 __ARGS((void));
  118. INTERRUPT pkvec1 __ARGS((void));
  119. INTERRUPT pkvec2 __ARGS((void));
  120.  
  121. #endif  /* MSDOS */
  122.  
  123. #endif  /* _PKTDRVR_H */
  124.